package com.easychat.entity.dto;

import com.easychat.entity.constants.Constants;
import com.easychat.utils.StringTools;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Arrays;

import static com.easychat.utils.StringTools.encodeMD5;

/**
 * @Author Dongdong
 * @注释 系统设置
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class SysSettingDto implements Serializable {
    private static final long serialVersionUID = 1L;
    // 最大群组数量
    private Integer maxGroupCount = 5;
    // 最大群组人数
    private Integer maxGroupMemberCount = 500;
    // 最大图片大小
    private Integer maxImageSize =2;
    //  最大视频大小
    private Integer maxVideoSize =5;
    // 最大文件大小
    private Integer maxFileSize =5;
    // 机器人UserID
    private String robotUid= Constants.RoBoT_UID;
    // 机器人昵称
    private String robotNickName ="EasyChat";
    // 机器人欢迎语
    private String robotWelcome ="欢迎使用EasyChat";

    @Override
    public String toString() {
        return "SysSettingDto{" +
                "maxGroupCount=" + maxGroupCount +
                ", maxGroupMemberCount=" + maxGroupMemberCount +
                ", maxImageSize=" + maxImageSize +
                ", maxVideoSize=" + maxVideoSize +
                ", maxFilesize=" + maxFileSize +
                ", robotUid='" + robotUid + '\'' +
                ", robotNickName='" + robotNickName + '\'' +
                ", robotWelcome='" + robotWelcome + '\'' +
                '}';
    }

    public Integer getMaxGroupCount() {
        return maxGroupCount;
    }

    public void setMaxGroupCount(Integer maxGroupCount) {
        this.maxGroupCount = maxGroupCount;
    }

    public Integer getMaxGroupMemberCount() {
        return maxGroupMemberCount;
    }

    public void setMaxGroupMemberCount(Integer maxGroupMemberCount) {
        this.maxGroupMemberCount = maxGroupMemberCount;
    }

    public Integer getMaxImageSize() {
        return maxImageSize;
    }

    public void setMaxImageSize(Integer maxImageSize) {
        this.maxImageSize = maxImageSize;
    }

    public Integer getMaxVideoSize() {
        return maxVideoSize;
    }

    public void setMaxVideoSize(Integer maxVideoSize) {
        this.maxVideoSize = maxVideoSize;
    }

    public Integer getMaxFileSize() {
        return maxFileSize;
    }

    public void setMaxFileSize(Integer maxFileSize) {
        this.maxFileSize = maxFileSize;
    }

    public String getRobotUid() {
        return robotUid;
    }

    public void setRobotUid(String robotUid) {
        this.robotUid = robotUid;
    }

    public String getRobotNickName() {
        return robotNickName;
    }

    public void setRobotNickName(String robotNickName) {
        this.robotNickName = robotNickName;
    }

    public String getRobotWelcome() {
        return robotWelcome;
    }

    public void setRobotWelcome(String robotWelcome) {
        this.robotWelcome = robotWelcome;
    }
//    // 过滤html标签方法
//    public static String cleanHtmlTag(String sendMessage) {
//        if (StringTools.isEmpty(sendMessage)) {
//            return sendMessage;
//        }
//
//        sendMessage = sendMessage.replace("<", "&lt;");
//        sendMessage = sendMessage.replace(">", "&gt;");
//        sendMessage = sendMessage.replace("\r\n", "<br>");
//        sendMessage = sendMessage.replace("\n", "<br>");
//        return  sendMessage;
//    }
//
//    //获取sessionId  保证两人的会话id一致 唯一
//    /*
//     * 好友会话 张三：123 李四：456 sessionId： MD5（123+456）、
//     * 群会话： 群主号直接MD5
//     */
//    public static String getChatSessionIdUser(String[] userIds) {
//        Arrays.sort(userIds);
//        return  encodeMD5(StringUtils.join(userIds, ""));
//    }
}
